package cn.hct.springboot_pro.service.impl;

import cn.hct.springboot_pro.dao.UserMapper;
import cn.hct.springboot_pro.entity.User;
import cn.hct.springboot_pro.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Repository
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userDao;

    @Override
    public User getUserByUnameAndPsw(String user_name, String password) {
        return userDao.getUserByUnameAndPsw(user_name,password);
    }

    @Override
    public int insertUser(String user_name, String phone, String password) {
        return userDao.insertUser(user_name,phone,password);
    }

    @Override
    public User getUserByUname(String user_name) {
        return userDao.getUserByUname(user_name);
    }

    @Override
    public User getUserById(int user_id) {
        return userDao.getUserById(user_id);
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public List<User> getUserByMan(int manager) {
        return userDao.getUserByMan(manager);
    }

    @Override
    public int deleteUserById(int user_id) {
        return userDao.deleteUserById(user_id);
    }

}
